package com.qigao.mall.api;

import com.github.pagehelper.PageInfo;
import com.qigao.mall.commons.dto.ProfitCondDto;
import com.qigao.mall.commons.dto.ProfitDetailResultDto;
import com.qigao.mall.commons.enums.Result;
import com.qigao.mall.commons.po.DivideAppyPo;
import com.qigao.mall.jdbc.model.TbBonusDetail;
import com.qigao.mall.jdbc.model.TbProfitDetail;
import com.qigao.mall.jdbc.model.TbSettleDetail;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author luiz
 * @Title: com.qigao.mall.api
 * @ProjectName market-parent
 * @date 2020-06-2020-06-19 11:10
 * @Description:
 */
public interface ProfitDetailService {
    void insertBatch(List<TbProfitDetail> tbProfitDetails);

    void insert(TbProfitDetail tbProfitDetail);

    void saveBatch(List<TbProfitDetail> tbProfitDetails);

    List<TbSettleDetail> selectSettleGroup(Date settleDate);

    List<TbBonusDetail> selectProfitGroup(Date settleDate);

    TbProfitDetail selectUserProfit(String userNo, Date settleDate);

    Result<PageInfo<ProfitDetailResultDto>> listPage(ProfitCondDto profitCondDto);

    List<ProfitDetailResultDto> findOrderResultByCond(ProfitCondDto profitCondDto);

    /**
     * 发起分账请求，确保最终成功
     * @param divideAppyPo
     */
    void applyDivide(DivideAppyPo divideAppyPo);
}
